package com.wanxi.properties;

import com.wanxi.util.Tool;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Properties;

public class MyPropertiesOutputWriter {
    public static void main(String[] args) {
        Properties properties = new Properties();
//        properties.put("张三", 111);
//        properties.put("李四", 222);
//        properties.put("王五", 2223);
//        properties.put("赵六", 444);
//        Set<Object> keys = properties.keySet();
//        for (Object key : keys
//        ) {
//            System.out.println(key + "=" + properties.get(key));
//        }
        properties.setProperty("zhangsan", "111");
        properties.setProperty("lisi", "222");
        properties.setProperty("wangwu", "333");
        String path = "E:\\wanxi\\step-2\\java02-0921\\day21OtherIOStream\\src\\com\\wanxi\\properties";
        String fileName = "a.txt";
        OutputStream outputStream = Tool.getFileOutputStream(path, fileName);
        try {
            properties.store(outputStream, "----");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
